package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CI_IMAGENES_2 database table.
 * 
 */
@Embeddable
public class CiImagenes2PK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long entRefnum;
	private String tipoObjeto;
	private long secuencial;
	private String codActoGral;

    public CiImagenes2PK() {
    }

	@Column(name="ENT_REFNUM", unique=true, nullable=false)
	public long getEntRefnum() {
		return this.entRefnum;
	}
	public void setEntRefnum(long entRefnum) {
		this.entRefnum = entRefnum;
	}

	@Column(name="TIPO_OBJETO", unique=true, nullable=false, length=8)
	public String getTipoObjeto() {
		return this.tipoObjeto;
	}
	public void setTipoObjeto(String tipoObjeto) {
		this.tipoObjeto = tipoObjeto;
	}

	@Column(unique=true, nullable=false, precision=5)
	public long getSecuencial() {
		return this.secuencial;
	}
	public void setSecuencial(long secuencial) {
		this.secuencial = secuencial;
	}

	@Column(name="COD_ACTO_GRAL", unique=true, nullable=false, length=5)
	public String getCodActoGral() {
		return this.codActoGral;
	}
	public void setCodActoGral(String codActoGral) {
		this.codActoGral = codActoGral;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CiImagenes2PK)) {
			return false;
		}
		CiImagenes2PK castOther = (CiImagenes2PK)other;
		return 
			(this.entRefnum == castOther.entRefnum)
			&& this.tipoObjeto.equals(castOther.tipoObjeto)
			&& (this.secuencial == castOther.secuencial)
			&& this.codActoGral.equals(castOther.codActoGral);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.entRefnum ^ (this.entRefnum >>> 32)));
		hash = hash * prime + this.tipoObjeto.hashCode();
		hash = hash * prime + ((int) (this.secuencial ^ (this.secuencial >>> 32)));
		hash = hash * prime + this.codActoGral.hashCode();
		
		return hash;
    }
}